export const addConsultUnit = (editor) => {
    const { Components } = editor;
    Components.addType('consultUnit', {
        model: {
            defaults: {
                name: 'consultUnit',
                droppable: false,
                attributes: { class: '' },
                components: [
                    {
                        type: 'div',
                        attributes: { class: 'show2' },
                        components: [
                            {
                                type: 'div',
                                attributes: { class: 'show1' },
                                components: [
                                    {
                                        type: 'image',
                                        attributes: { class: 'show3' },
                                    },
                                    {
                                        type: 'div',
                                        attributes: { class: 'show4' },
                                        components: [
                                            {
                                                type: 'text',
                                                attributes: { class: 'textContentTime' },
                                                content: '08-23'
                                            },
                                            {
                                                type: 'div',
                                                attributes: { class: 'show5' },
                                                components: [
                                                    {
                                                        type: 'text',
                                                        attributes: { class: 'textContentWeight' },
                                                        content: '印度客机因乘客手机爆炸紧急降落：乘客均安全'
                                                    },
                                                    {
                                                        type: 'text',
                                                        attributes: { class: 'textContent' },
                                                        content: '快科技7月18日消息，据当地报道，日前一架飞往德里的印度航空客机起飞过程中突发意外，一名乘客的手机爆炸，飞机随后紧急降落。报道称，机上140名乘客均安全...'
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                ]
                            },
                            {
                                type: 'div',
                                attributes: { class: 'show6' },
                                components: [
                                    {
                                        type: 'div',
                                        attributes: { class: 'show7' },
                                        components: [
                                            {
                                                type: 'div',
                                                attributes: { class: 'show8' },
                                                components: [
                                                    {
                                                        type: 'text',
                                                        attributes: { class: 'textContentWeight' },
                                                        content: '· 印度客机因乘客手机爆炸紧急降落：乘客均安全'
                                                    },
                                                    {
                                                        type: 'text',
                                                        attributes: { class: 'textContent' },
                                                        content: '快科技7月18日消息，据当地报道，日前一架飞往德里的印度航空客机起飞过程中突发意外，一名乘客的手机爆炸，飞机随后紧急降落。报道称...'
                                                    },
                                                ]
                                            },
                                            {
                                                type: 'div',
                                                attributes: { class: 'show9' },
                                                content: '<text style="font-size: 10px;font-weight: 300;">08-23</text>\
                          <div style="border: solid 1px gray; width: 0px;height: 14px;margin-top: 10px;">\
                              <text style="margin-left: 10px;font-weight: 300;">→</text>\
                          </div>'
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                    },
                ],
                styles: `
                .show9{
                    text-align: center;
                    margin-top: 10px;
                    margin-left: 10px;
                }
                .show8{
                    width: 360px;
                }
                .show7{
                    display: flex;
                    height:80px;
                    border-bottom: 1px solid lightgray;
                }
                .show6{
                    flex-direction: column;
                }
                .show5{
                    padding-top: 20px;
                    width: 350px;
                    height:100px;
                }
                .show4{
                    display: flex;
                    width: 100%;
                    height:100px;
                }
                .show3{
                    background-color: gray;
                    width: 450px;
                    height: 250px;
                }
                .show2{
                    display:flex;
                }
                .show1{
                    height:360px;
                    width: 500px;
                }
                      .textContentDay {
                      font-size: 10px;
                  font-weight: 300;
              }
              .textContent {
                  width: 350px;
                  font-size: 10px;
                  font-weight: 300;
                  margin-top: 10px;
              }
              .textContentTime {
                  width: 100px;
                  height: 50px;
                  font-size: 28px;
                  font-weight: 500;
                  margin-top: 20px;
              }
              .textContentWeight {
                  width: 350px;
                  heigth: 80px;
                  font-size: 12px;
                  font-weight: 540;
              }
                  `,
            },
        },
    });
    editor.BlockManager.add("consultUnit", {
        label: "咨询栏单元",
        category: "产品中心组件",
        select: true,
        content: { type: "consultUnit" },
        media:`<svg xmlns="http://www.w3.org/2000/svg" height="30" width="30" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M96 96c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H80c-44.2 0-80-35.8-80-80V128c0-17.7 14.3-32 32-32s32 14.3 32 32V400c0 8.8 7.2 16 16 16s16-7.2 16-16V96zm64 24v80c0 13.3 10.7 24 24 24H296c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24H184c-13.3 0-24 10.7-24 24zm208-8c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H384c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16s-7.2-16-16-16H384c-8.8 0-16 7.2-16 16zM160 304c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H176c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H176c-8.8 0-16 7.2-16 16z"/></svg>`
      });
};
